package com.yanqu.road.server.cmd.cookboy.cross;

import com.yanqu.road.pb.cookboy.CookBoyProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_CROSS_COOK_BOY_PUBLIC_TABLE_SYNC, desc = "跨服同步食材比赛桌子")
public class CrossFoodTableCmd extends AbstractCommand {

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		CookBoyProto.CookBoyPublicTableSyncMsg crossSyncMsg = CookBoyProto.CookBoyPublicTableSyncMsg.parseFrom(packet.getBytes());
		GamePlayer gamePlayer = GamePlayerMgr.getOnlinePlayer(packet.getPlayerId());
		CookBoyProto.CookBoyPublicTableSyncMsg.Builder respMsg = CookBoyProto.CookBoyPublicTableSyncMsg.newBuilder(crossSyncMsg);
		gamePlayer.sendPacket(Protocol.U_COOK_BOY_SERVE_TABLE_SYNC, respMsg);
	}

	@Override
	public void sendData(GamePlayer player) {

	}
}
